/*
 * Copyright (C) 2021 xuexiangjys(xuexiangjys@163.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.igitalExplorer.SketchDemo.fragment.work.home;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.igitalExplorer.SketchDemo.R;
import com.igitalExplorer.SketchDemo.core.BaseFragment;
import com.igitalExplorer.SketchDemo.databinding.FragmentWorkHomeBinding;
import com.igitalExplorer.SketchDemo.fragment.work.distance.LeftDistanceFragment;
import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.enums.CoreAnim;
import com.xuexiang.xui.widget.actionbar.TitleBar;

/**
 * @author zhangliang
 * @since 2021-12-10 17:15
 */
@Page(anim = CoreAnim.none)
public class WorkHomeFragment extends BaseFragment<FragmentWorkHomeBinding> implements View.OnClickListener {

    @NonNull
    @Override
    protected FragmentWorkHomeBinding viewBindingInflate(LayoutInflater inflater, ViewGroup container) {
        return FragmentWorkHomeBinding.inflate(inflater, container, false);
    }

    @Override
    protected TitleBar initTitle() {
        return null;
    }

    @Override
    protected void initViews() {

    }

    @Override
    protected void initListeners() {
        binding.btnLeftDistance.setOnSuperTextViewClickListener(this::onClick);
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.btn_left_distance) {
            openNewPage(LeftDistanceFragment.class);
        }
    }
}